/*
 * Copyright (c) 2018/12/9 . All Rights Reserved.
 */
package com.cgmnx.admin.web.converter.entity;

import com.cgmnx.admin.dao.entity.RankNumEntity;
import com.cgmnx.admin.model.enums.RankNumType;
import com.cgmnx.admin.web.converter.Convert;
import com.cgmnx.admin.web.model.param.RankNumSaveParam;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author: z Date: 2018/12/9 Time: 下午4:37
 * @version: 1.0.0
 */
@Component
public class RankNumEntityConverter implements Convert<RankNumSaveParam, RankNumEntity> {

    @Override
    public RankNumEntity convert(RankNumSaveParam t) {

        RankNumEntity entity = new RankNumEntity();
        entity.setNoteId(t.getNoteId());
        entity.setRankNum(t.getRankNum());
        entity.setOrders(t.getOrders());
        entity.setRankType(RankNumType.codeOf(t.getRankType()));
        entity.setCreateUser("HUAYANG");
        entity.setUpdateUser("HUAYANG");
        return entity;
    }

    @Override
    public List<RankNumEntity> convert(List<RankNumSaveParam> t) {
        throw new UnsupportedOperationException();
    }
}
